SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
alter   trigger tt_tradersetacc_ai on tt_tradersetacc for insert as
begin
  set nocount on

  update tt_tradersetacc set bscamt=t.bbalance-t.bsuramt,escamt=t.ebalance-t.esuramt
    , dcbscamt=t.dcbbalance-t.dcbsuramt,dcescamt=t.dcebalance-t.dcesuramt
    from tt_tradersetacc t, inserted i
    where t.accyear=i.accyear and t.accmonth=i.accmonth and t.traderid=i.traderid and t.moneyid=i.moneyid
  
end


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

